package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.DeviceStatusLogMapper;
import com.hello.system.domain.DeviceStatusLog;
import com.hello.system.service.IDeviceStatusLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 设备状态记录Service业务层处理
 * 
 * @author hello
 * @date 2025-09-09
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DeviceStatusLogServiceImpl extends ServiceImpl<DeviceStatusLogMapper, DeviceStatusLog> implements IDeviceStatusLogService 
{
    private final DeviceStatusLogMapper deviceStatusLogMapper;

    /**
     * 查询设备状态记录
     * 
     * @param logId 设备状态记录主键
     * @return 设备状态记录
     */
    @Override
    public DeviceStatusLog selectDeviceStatusLogByLogId(Long logId)
    {
        return deviceStatusLogMapper.selectDeviceStatusLogByLogId(logId);
    }

    /**
     * 查询设备状态记录列表
     * 
     * @param deviceStatusLog 设备状态记录
     * @return 设备状态记录
     */
    @Override
    public List<DeviceStatusLog> selectDeviceStatusLogList(DeviceStatusLog deviceStatusLog)
    {
        return deviceStatusLogMapper.selectDeviceStatusLogList(deviceStatusLog);
    }

    /**
     * 新增设备状态记录
     * 
     * @param deviceStatusLog 设备状态记录
     * @return 结果
     */
    @Override
    public int insertDeviceStatusLog(DeviceStatusLog deviceStatusLog)
    {
        deviceStatusLog.setCreateTime(DateUtils.getNowDate());
        return deviceStatusLogMapper.insertDeviceStatusLog(deviceStatusLog);
    }

    /**
     * 修改设备状态记录
     * 
     * @param deviceStatusLog 设备状态记录
     * @return 结果
     */
    @Override
    public int updateDeviceStatusLog(DeviceStatusLog deviceStatusLog)
    {
        deviceStatusLog.setUpdateTime(DateUtils.getNowDate());
        return deviceStatusLogMapper.updateDeviceStatusLog(deviceStatusLog);
    }


    /**
     * 批量删除设备状态记录
     * 
     * @param logIds 需要删除的设备状态记录主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusLogByLogIds(Long[] logIds)
    {
        return deviceStatusLogMapper.deleteDeviceStatusLogByLogIds(logIds);
    }

    /**
     * 删除设备状态记录信息
     * 
     * @param logId 设备状态记录主键
     * @return 结果
     */
    @Override
    public int deleteDeviceStatusLogByLogId(Long logId)
    {
        return deviceStatusLogMapper.deleteDeviceStatusLogByLogId(logId);
    }
}
